use ansi_term::Style;
use ansi_term::Colour::*;
pub fn basic_run(){
    let bold = Style::new().bold().on(White).paint("加粗");
    println!("{}", bold);
    let underline = Style::new().underline().on(Red).paint("下划线");
    println!("{}", underline);
    let dimmed = Style::new().dimmed().on(White).paint("dimmed");
    println!("{}", dimmed);
    let italic = Style::new().italic().on(Yellow).paint("斜体");
    println!("{}", italic);
    let blink= Style::new().blink().on(Green).paint("blink");
    println!("{}", blink);
    let reverse= Style::new().reverse().on(Blue).paint("reverse");
    println!("{}", reverse);
    let hidden= Style::new().hidden().on(White).paint("隐藏");
    println!("{}", hidden);
    let strike= Style::new().strikethrough().paint("删除线");
    println!("{}", strike);



    let yellow = Yellow.underline().paint("黄色下划线");
    let blue = Blue.on(White).bold().paint("蓝色加粗");
    println!("{}", yellow);
    println!("{}", blue);
    

    // 颜色索引值
    let fix_color = Fixed(134).paint("紫色");
    let mix_color = Fixed(221).on(Fixed(124)).paint("调色");
    println!("{},{}", fix_color,mix_color);

    let rgb_color =RGB(70,130,180).paint("深蓝");
    println!("{}", rgb_color);

    let some_value = format!("{:b}",42);
    
    let strings = &[
        Red.paint("["),
        Green.bold().paint(some_value),
        Red.paint("]"),
    ];

    println!("Value:{}",ansi_term::ANSIStrings(strings));
    
    ansi_term::ANSIByteStrings(&[
        Green.paint("user data 1\n".as_bytes()),
        Green.bold().paint("user data 2\n".as_bytes()),
    ]).write_to(&mut std::io::stdout()).unwrap();

}
